package com.y.demo.mapper;


import com.y.demo.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserMapper {
	@Select("select * from user")
	List<User> findAll();

	@Select("select * from user where id=#{id}")
	User findOne(int id);

	@Update("update user set name=#{name},phone=#{phone} where id=#{id}")
	int updateUser(@Param("name")String name,@Param("phone")String phone,@Param("id")int id);

	@Delete("delete from user where id = #{id}")
	int deleteUser(@Param("id")int id);

	@Insert("insert into user(name,phone) values(#{name},#{phone})")
	int insertUser(@Param("name")String name,@Param("phone")String phone);
}
